-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valid the authorized nodes in the node shared secret #715
Valid the authorized nodes in the node shared secret #715
Conversation
Enum.all?( | ||
Map.keys(authorized_keys), | ||
&Utils.key_in_node_list?(nodes, &1) | ||
authorized_keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be more clear without the pipeline by extracting variables and do simple comparison.
…tion_and_node_renewal_are_equal_
&Utils.key_in_node_list?(nodes, &1) | ||
) do | ||
{:ok, _, _} <- NodeRenewal.decode_transaction_content(content), | ||
true <- sorted_authorized_keys == sorted_node_renewal_authorized_keys do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may add a unit test to ensure the error when both list are different.
Otherwise it works well 👍
…tion_and_node_renewal_are_equal_
…ation#715) * Valid the authorized nodes in the node shared secret * refactoring * added test
Description
Actually during the pending validation, we control if the new authorized nodes in the node shared secret transaction are part of the candidate, but we do not verify if the selected ones are the good ones.
We should not verify if the new authorized nodes are part of the candidate, but directly verify that all authorized nodes are the same as the return of the function NodeRenewal.next_authorized_node_public_keys()
Fixes #694
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
we make sure that the authorized nodes in the transaction are exactly the same as the ones returned by
next_authorized_node_public_keys function
Checklist: